#define  _CRT_SECURE_NO_WARNINGS 1
#include "game.h"
void menu()
{
	printf("**************************\n");
	printf("********  1.play  ********\n");
	printf("********  0.exit  ********\n");
	printf("**************************\n");
}
void game()
{
	char mine[ROWS][COLS];
	char show[ROWS][COLS];
	//初始化
	InitBoard(mine, ROWS, COLS, '0');
	InitBoard(show, ROWS, COLS, '*');
	//打印棋盘
	//Display(mine, ROW, COL);
	Display(show, ROW, COL);
	//放置雷
	SetBoom(mine, ROW, COL);
	//输入坐标
	FindBoom(mine,show,ROW,COL);    
}
void test()
{
	int input=0;
	srand((unsigned int)time(NULL));
	do {
		menu();
		printf("请输入：");
		scanf("%d", &input);
		switch (input)
		{
			case 1:
				game();
				break;
			case 0:
				printf("游戏结束");
				break;
			default:
				printf("输入有误，请重新输入：");
				break;
		}

	} while (input);
}
int main()
{
	test();
	return 0;
}